package com.jh.readme.iu.fragment.newslist;

import com.jh.tools.base.BaseFPresenter;
import com.jh.tools.base.BaseModel;
import com.jh.tools.base.BaseView;
import com.jh.tools.bean.NeteastNewsSummary;

import java.util.List;
import java.util.Map;

import rx.Observable;

/**
 * Home抽象类
 */
public interface NewsListContract {
    interface Model extends BaseModel {
        /**
         * 获取新闻
         * @param  频道ID
         * @param cPage //要获取的页数
         */
        Observable<Map<String, List<NeteastNewsSummary>>> getNewsDate(Map<String ,String> params, long cPage);
    }


    interface View extends BaseView {

        /**
         * 初始化新闻列表
         * @param neteastNewsSummary
         */
        void initNewList(List<NeteastNewsSummary> neteastNewsSummary);
    }

    abstract class Presenter extends BaseFPresenter<Model, View> {

        abstract void getInitView(Map<String ,String> params);

        @Override
        public Observable getDate(Map params) {
            return mModel.getDate(params);
        }

        abstract void getNews(Map<String ,String> params, long cPage);
    }
}